package Arry一维数组;

import java.util.Scanner;

public class Arry02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生人数");
        int num = sc.nextInt();
        int max = 0;
        int[] arr = new int[num];
        for (int i = 0; i < num; i++) {
            System.out.println("请输入第"+(i+1)+"个学生成绩");
            arr[i] = sc.nextInt();
            if (arr[i] > max) {
                max = arr[i];
            }
            System.out.println("输出最高成绩为："+max);
        }
        char grade = ' ';
       for (int i = 0; i < num; i++) {
            if (arr[i]>=85&&arr[i]<=100) {
                System.out.println(grade='A');
            }else if (arr[i]<85&&arr[i]>70) {
                System.out.println(grade='B');
            }else if (arr[i] >=70&&arr[i]<=60) {
                System.out.println(grade='C');
            } else  {
                System.out.println(grade='D');
            }
           System.out.println("第"+(i+1)+"个学生的成绩为："+arr[i]+"\n等级为:"+grade);
       }

    }
}
